﻿namespace GmailReader
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    public class Account
    {
        private AccountReader reader;

        public string Email { get; private set; }

        public IList<Email> UnreadedEmails { get; private set; }

        public int UnreadedCount { get; private set; }

        public Account(string email, string password)
        {
            this.Email = email;
            this.reader = new AccountReader(email, password);
            this.Update();
        }

        public void Update()
        {
            this.UnreadedEmails = this.reader.GetUnreadedMails();
            this.UnreadedCount = this.UnreadedEmails.Count;
        }
    }
}
